package com.sne.airways.system.service;

import com.sne.airways.basecore.exceptions.AppException;
import com.sne.airways.system.dto.TdRoleCheckDTO;
import com.sne.airways.system.dto.TdRoleDTO;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: skyline{http://my.oschina.net/skyline520}
 * Date: 12-11-23
 * Time: 下午5:48
 * To change this template use File | Settings | File Templates.
 */
public interface RoleService {
    /**
     * 查询角色列表
     * @param roleNo
     * @param roleName
     * @param status
     * @param start
     * @param limit
     * @return
     */
    public List<TdRoleDTO> queryRoleList(String roleNo, String roleName, String status, int start, int limit) throws AppException;

    /**
     * 查询角色记录总数
     * @param roleNo
     * @param roleName
     * @param status
     * @return
     */
    public Integer queryRoleCount(String roleNo, String roleName, String status) throws AppException;
    /**
     * 保存角色
     * @param roleNo
     * @param roleName
     * @param roleDesc
     * @param status
     * @param version
     * @return
     * @throws com.sne.airways.basecore.exceptions.AppException
     */
    public void saveRole(String roleNo, String roleName, String roleDesc, String status, int version) throws AppException;

    /**
     * 编辑角色
     * @param roleId
     * @param roleNo
     * @param roleName
     * @param roleDesc
     * @param status
     * @param version
     * @return
     * @throws com.sne.airways.basecore.exceptions.AppException
     */
    public void updateRole(String roleId, String roleNo, String roleName, String roleDesc, String status, int version) throws AppException;

    /**
     * 删除角色
     * @param roleId
     * @param version
     * @throws com.sne.airways.basecore.exceptions.AppException
     */
    public void deleteRole(String roleId, int version) throws AppException;

    /**
     * 保存用户角色关联关系
     * @param roleId
     * @param idArray
     * @param version
     * @throws AppException
     */
    public void saveRoleUser(String roleId,String[] idArray,int version) throws AppException;
    /**
     * 保存角色资源关联关系
     * @param roleId
     * @param idArray
     * @param version
     * @throws AppException
     */
    public void saveRoleOperation(String roleId,String[] idArray,int version) throws AppException;
    public List<String> queryRoleCheckedList(String userId) throws AppException ;
    public void saveUserRole(String userId,String[] ids) throws AppException;
}
